package com.yao2san;

import com.yao2san.sim.framework.cloud.config.CloudConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import response.ResponseData;

@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
@RestController

public class SprringCloudApplication {
    public static void main(String[] args) {
        SpringApplication.run(SprringCloudApplication.class, args);
    }

    @RequestMapping("/test/{key}")
    public ResponseData test(@PathVariable("key") String key) {
        return ResponseData.success(CloudConfig.getValue(key));
    }
}
